// 专栏->文章
import request from '@/utils/request';

export function getPosts(params) {
  return request({
    url: `posts/${params}`,
    method: 'get',
  });
}
// 获取属于专栏下的文章
export function getPostsInColumn(params) {
  return request({
    url: `columns/${params.currentId}/posts`,
    method: 'get',
    params,
  });
}

export function createPosts(data) {
  return request({
    url: 'posts',
    method: 'post',
    data,
  });
}

export function delPosts(data) {
  return request({
    url: 'posts/{id}',
    method: 'detail',
    data,
  });
}
export function updatePosts(data) {
  return request({
    url: 'posts/{id}',
    method: 'patch',
    data,
  });
}
